
define(function(require, exports, modules) {
	'use strict';

	require('css!assets/css/loading/loading.css');

	var template = require('text!./tpl.share.html'), 
		util = require('util');
	var View = Backbone.View.extend({
		el : '#page',
		events : {
			'click .btn-register':'register',
			'click .btn-login':'toLogin'
		},
		initialize : function() {
			this.template = _.template(template);
			this.render();
		},
		render : function() {
			this.$el.html(this.template());
			var user=JSON.parse(util.getCookie('user'));
			var parm = '';
			if(user){
				parm = '?userRefId='+user.userRefId;
			}
			history.replaceState({},'',location.origin + location.pathname + '#register' + parm);
		}
	});

	return View;
});